<?php

class MutipleChoice extends Content implements IContentExtra
{
    /**
     * array(
     *      'id'=> xxxx,
     *      'title' => xxxx,
     *      'text' => xxxx,
     * )
     * @var array
     */
    public $choices=array();
    
    public function behaviors()
    {
        return array(
            'embeddedSubjects'=>array(
                'class'=>'common.extensions.YiiMongoDbSuite.extra.EEmbeddedArraysBehavior',
                'arrayPropertyName'=>'choices',
                'arrayDocClassName'=>'Choice'
            ),
        );
    }
    
    static public function getTypeName()
    {
        return 'mutiple_choice';
    }
    
    static public function getInstanceByAttributes($attributes = null, $runSetAttributes = true)
    {
        $model = new self;
        if($runSetAttributes)
            $model->setAttributes($attributes);

        return $model;
    }
    
    public function getDisplaySummary()
    {
        return $this->text;
    }
}

